/*
 * Task_Timer.c
 *
 *  Created on: 2018-3-24
 *      Author: root
 */
#ifndef TASK_TIMER_C_
#define TASK_TIMER_C_

#include "Task_Timer.h"
#include "sys.h"
#include "stddef.h"
#include <unistd.h>
#include "tcu_can.h"

TTaskInfo Info_Task_Timer;
#define TIMER_1S   1
void timer_100ms(void)//1秒一次
{
 	_addtime_(TIMER_100MS);//TIMER_100MS
}
OS_TaskRet Task_Timer_can(void *arg)
{

//	struct timeval timer;
	while(1)
	{
//		timer.tv_sec = 0;
//		timer.tv_usec =100000;//100ms
//		if (select(0, NULL, NULL, NULL, &timer) == 0) {
//
//			timer_100ms();
//		}
		usleep(100000);
		timer_100ms();

	}
	return NULL;
}
void initTask_Timer_can(void)
{
	Info_Task_Timer.Prio = DEFAULT_PRIO;
	Info_Task_Timer.Stk = NULL;
	Info_Task_Timer.Stk_Size = 0;
    os_create_task(Task_Timer_can, NULL, &Info_Task_Timer);
}

#endif /* TASK_TIMER_C_ */
